package com.xinke.query.model.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;

public enum QueryType implements BaseEnum {
    PASSDATA(1, "高速卡口/出口记录"),
    ETCINFO(2, "etc登记信息"),
    PASSPICDATA(3, "高速卡口/出入口图片信息");

    @EnumValue
    @JsonValue
    private Integer code;
    private String name;

    QueryType(Integer code, String name) {
        this.code = code;
        this.name = name;
    }


    @Override
    public Integer getCode() {
        return this.code;
    }

    @Override
    public String getName() {
        return this.name;
    }

    public static boolean contains(Integer code) {
        if (code == null) {
            return false;
        }
        for (QueryType value : QueryType.values()) {
            if (value.getCode().equals(code)) {
                return true;
            }
        }
        return false;
    }

}
